import matplotlib.pyplot as plt
import numpy as np

# 散点图
x = np.linspace(0, 10, 100)
plt.scatter(x, np.sin(x))
plt.show()

np.random.seed(0)  # 设置随机种子
x = np.random.rand(100)
y = np.random.rand(100)
colors = np.random.rand(100)
size = np.random.rand(100) * 1000
plt.scatter(x, y, c=colors, s=size, alpha=0.7)
plt.show()
